<div class="login_register_box" th:if="${#httpSession.getAttribute('profile.login')==null}">
      <section th:replace="/views/mobile/partial/login_header"></section>
      <div class="form_container" id="login_form_container">
          <section th:replace="/views/mobile/partial/login_form"></section>
          <a href="http://www.faxsun.com/shop/login/forgotPassword"><span >忘记密码？</span></a>
          <span style="float:right" id="register_anchor">用户注册</span>
         
      </div>

      <div class="form_container" id="register_form_container">
          <section th:replace="/views/mobile/partial/register_form"></section>
      </div>
</div>

<section th:replace="/views/mobile/partial/agreement_content"></section>

<section th:replace="/views/mobile/partial/login_loading"></section>


<script th:if="${#httpSession.getAttribute('profile.login')==null}" type="text/javascript" th:src="@{/src/js/jq.validate.js}"></script>
<script th:if="${#httpSession.getAttribute('profile.login')==null}" type="text/javascript">
    $(".login_register_box").css("height",$(window).height());

    $("#login_loading_mobile").css("height",$(window).height());

    $("#agreement-content").css("height",$(window).height());

    $("#agreement_span").click(function(){

      $("#agreement-content").css("display","block");
    });

    $("#overlay-close").click(function(){
      $("#agreement-content").css("display","none");
    });

    $("#login_loading_close").click(function(){
      $("#login_loading_mobile").css("display","none");
    });

   $(".login_button").click(function(){
        $(".cover").css({"left":"100%","display":"none"});
        $(".wrap-header").css("display","none");
        $("#login_form_container").css("display" ,"block");
        $("#register_form_container").css("display","none");
        $(".wrap-container").css("display","none");
        $(".login_register_box").css("display" ,"block");
         document.body.removeEventListener('touchmove',disableTouchmove);
   });
   $(".register_button").click(function(){
        $(".cover").css({"left":"100%","display":"none"});
        $(".wrap-header").css("display","none");
        $("#register_form_container").css("display" ,"block");
        $("#login_form_container").css("display","none");
        $(".wrap-container").css("display","none");
        $(".login_register_box").css("display" ,"block");
         document.body.removeEventListener('touchmove',disableTouchmove);
   });

   $("#register_anchor").click(function(){
        $("#register_form_container").css("display" ,"block");
        $("#login_form_container").css("display","none");
   });

    $("#alreadyHaveAccount").click(function(){
        $("#login_form_container").css("display" ,"block");
        $("#register_form_container").css("display","none");
        $(".login_register_box").css("display" ,"block");
   });

    

    $(function(){
         $('form').validate({
            type:{
              isChecked: function(value, errorMsg, el) {
                var i = 0;
                var $collection = $(el).find('input:checked');
                if (!$collection.length) {
                  return errorMsg;
                }
              }
            },
            onFocus: function() {
              this.parent().addClass('active');
              return false;
            },
            onBlur: function() {
              var $parent = this.parent();
              var _status = parseInt(this.attr('data-status'));
              $parent.removeClass('active');
              if (!_status) {
                $parent.addClass('error');
              }
              return false;
            }
        });
    });
</script>



